﻿namespace GuiaTest
{
    using System;
    using Guia.Core;
    using Guia.Elements;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    using WpfTestApplication;

    /// <summary>
    /// Summary description for DatePickerTest
    /// </summary>
    [TestClass]
    public class ControlTemplateTest : AbstractWindowTest
    { 
        [TestMethod]
        [Ignore]
        public void TestButtonToolTip()
        {
            // Tooltip is not affected by the template
            Button fancyButton = this.window.Get<Button>("fancyButton");
            Assert.AreEqual("Tooltip", fancyButton.ToolTip);
        }

        [TestMethod]
        [Ignore]
        public void TestButtonInvoke()
        {
            // Invoke (and other patterns) are not affected by the template
            Label refLabel = this.window.Get<Label>("label");
            Button fancyButton = this.window.Get<Button>("fancyButton");
            Assert.AreEqual("-", refLabel.TextValue);
            fancyButton.Invoke();
            Delay.ForMilliseconds(10);
            Assert.AreEqual("Clicked", refLabel.TextValue);
        }

        [TestMethod]
        [Ignore]
        public void TestButtonClick()
        {
            // Click may be affected by the template
            Label refLabel = this.window.Get<Label>("label");
            Button fancyButton = this.window.Get<Button>("fancyButton");
            Assert.AreEqual("-", refLabel.TextValue);
            fancyButton.ClickLeft();
            Delay.ForMilliseconds(10);
            Assert.AreEqual("Clicked", refLabel.TextValue);
        }

        [TestMethod]
        [Ignore]
        public void TestButtonName()
        {
            // Textvalue is not affected by the template
            Button fancyButton = this.window.Get<Button>("fancyButton");
            Assert.AreEqual("Click me!", fancyButton.TextValue);
        }

        #region Overrides of AbstractWindowTest

        protected override Type TestWindowType()
        {
            return typeof(ControlTemplateTestWindow);
        }

        protected override string TestWindowName()
        {
            return "ControlTemplateTestWindow";
        }

        #endregion
    }
}
